Miniscript Template: 0
  Title: Proposed Timelock Usage
  Created: 2023-09-11
  1. Name of Template

Proposed Timelock Usage

  1. Goal to be achieved by template

Miniscript facilitates easier access to utilizing timelocks in Bitcoin, it opens a new frontier in Bitcoin security concerning the construction of more advanced Scripts. This document aims to standardize timelock application across different wallet solutions, focusing on wallet recovery and standardizing expected timelock usage for streamlined hardware and software wallet interfaces.

In the event an output descriptor has been partially or fully lost, minimizing the overall search space for expected timestamp values can expedite recovery. General Miniscript usage supports any valid timelock value, this proposal seeks to guide implementation to more user-friendly practices.

Block height based Timelocks:

Absolute block height based Timelocks

Proposal: Set absolute block height-based timelocks as multiples of 100, always ending in 00.

Examples of valid Block Height Absolute Timelocks

Relative block height based Timelocks

Proposal: Make relative block height-based timelocks multiples of 100, except for the maximum value, 65,536 (2^16).

Epoch timestamp based Timelocks:

Absolute Epochtime based Timelocks

Proposal: To synchronize with real-world time rather than block time, employ epoch timestamps that are divisible by 43200 (Noon GMT) or 86400 (Midnight GMT). Optimally, use multiples of 604800 for Thursday at Midnight GMT.

Limitation: Avoid setting epoch timestamps beyond 2105 (4291704000) to prevent any possible issue with related to its 32 bit unsigned integer used for timestamps to happen in in February of 2106.

Propsoed Examples of valid Epoch Timestamp Absolute Timelocks

Relative Epochtime based Timelocks

Proposed Examples of valid Block Height Relative Timelocks:

Background:

, an exception should be made for the largest possible epoch timestamp relative timelock.

Proposal: Starting at 4194304, increment by 675 (4 days), for relative epochtime timelocks, the maximum value being 4259839.

Propsoed Examples of valid Epoch Timestamp Absolute Timelocks